# CC ?= gcc

# CFLAGS	?= -std=c11 -Wall -Wextra -Wpedantic -Werror -g
# LDFLAGS =  -T memory_region.ld

# OUTPUT_DIR ?= .

# SRCS		= main.c
# OBJS		= $(SRCS:.c=.o)
# TARGET		= $(OUTPUT_DIR)/exercise-11

# all:$(TARGET)

# $(TARGET): $(OBJS)
# 	$(CC) $(LDFLAGS) -nostartfiles $< -o $@  

# %.o: %.c
# 	$(CC) -c $(CFLAGS) $< -o $@

# clean:
# 	rm -f $(TARGET) $(OBJS)
CC ?= gcc

CFLAGS	?= -std=c11 -Wall -Wextra -Wpedantic -Werror -g
LDFLAGS =  -T memory_region.ld

SRCS		= main.c
OBJS		= $(SRCS:.c=.o)
TARGET		= $(OUTPUT_DIR)/exercise-11

$(TARGET): $(OBJS)
	$(CC) $(LDFLAGS) -nostartfiles -o $@ $^

%.o: %.c
	$(CC) $(CFLAGS) -c -o $@ $<

clean:
	rm -f $(TARGET) $(OBJS)
